﻿--4 - Найти людей с определенным типом контакта

select [LastName], [Name] from [MyFamily].[dbo].[Persons]
where [ID] in 
(select [fk_PersonID]
 from  [MyFamily].[dbo].[Contact] where [ContactType] ='E-mail')

select [LastName], [Name] from [MyFamily].[dbo].[Persons]
join 
  [MyFamily].[dbo].[Contact]
    on [MyFamily].[dbo].[Persons].[ID] = [MyFamily].[dbo].[Contact].[fk_PersonID]
	where [MyFamily].[dbo].[Contact].[ContactType] ='E-mail'
